geocache.cc
geojson.cc
globalsat_sport.cc
- gpssim.cc
gtm.cc
gtrnctr.cc
holux.cc
geo
globalsat_sport
gpsdrive
- gpssim
gpx
grapheme
gtm
--- /dev/null
+/*
+ Write points to Franson Technology GpsGate simulator
+
+ Copyright (C) 2006 Robert Lipe, robertlipe+source@gpsbabel.org
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ */
+
+
+#include "defs.h"
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include "nmea.h"
+
+#define MYNAME "gpssim"
+
+static gbfile* fout;
+static char* wayptspd;
+static char* splitfiles_opt;
+static int splitfiles;
+static QString fnamestr;
+static int trk_count;
+static int doing_tracks;
+
+static
+QVector<arglist_t> gpssim_args = {
+ {
+ "wayptspd", &wayptspd, "Default speed for waypoints (knots/hr)",
+ nullptr, ARGTYPE_FLOAT, ARG_NOMINMAX, nullptr
+ },
+ {
+ "split", &splitfiles_opt, "Split input into separate files",
+ "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
+ },
+};
+
+/*
+ * The only thing kind of odd about this format is the "split"
+ * option. There's some trashing about with the 'splitfiles' toggle
+ * to ensure that waypoints land in one file and each track and each
+ * route land in files of their own.
+ */
+
+static void
+gpssim_wr_init(const QString& fname)
+{
+ fnamestr = fname;
+ trk_count = 0;
+ splitfiles = splitfiles_opt ? xstrtoi(splitfiles_opt, nullptr, 10) : 0;
+
+ /* If writing to stdout, never split files */
+ if (0 == strcmp("-",splitfiles_opt)) {
+ splitfiles = 0;
+ }
+
+ if (!splitfiles) {
+ fout = gbfopen(fname, "wb", MYNAME);
+ }
+}
+
+static void
+gpssim_wr_deinit()
+{
+ if (fout) {
+ gbfclose(fout);
+ fout = nullptr;
+ }
+
+ fnamestr.clear();
+}
+
+
+/*
+ * All these files are written in binary mode, so put CR/NL pairs
+ * in them explictly in case we're writing from a UNIX-like host.
+ */
+
+static void
+gpssim_write_sentence(const char* const s)
+{
+ gbfprintf(fout, "$%s*%02X\r\n", s, NmeaFormat::nmea_cksum(s));
+}
+
+static void
+gpssim_write_spd(double knotsperhour)
+{
+ char obuf[1024];
+
+ snprintf(obuf, sizeof(obuf), "FRSPD,%.2f", knotsperhour);
+ gpssim_write_sentence(obuf);
+}
+
+static void
+gpssim_write_pt(const Waypoint* wpt)
+{
+ char obuf[1024];
+
+ if (wpt->speed_has_value()) {
+ gpssim_write_spd(MPS_TO_KNOTS(wpt->speed_value()));
+ }
+
+ double lat = degrees2ddmm(wpt->latitude);
+ double lon = degrees2ddmm(wpt->longitude);
+
+ snprintf(obuf, sizeof(obuf), "FRWPT,%10.5f,%c,%011.5f,%c,%.1f",
+ fabs(lat), lat < 0 ? 'S' : 'N',
+ fabs(lon), lon < 0 ? 'W' : 'E',
+ wpt->altitude == unknown_alt ? 0 : wpt->altitude
+ );
+
+ if (wpt->creation_time.isValid()) {
+ char tbuf[20];
+
+ QByteArray dmy = wpt->GetCreationTime().toUTC().toString(u"ddMMyy").toUtf8();
+ QByteArray hms = wpt->GetCreationTime().toUTC().toString(u"hhmmss").toUtf8();
+
+ snprintf(tbuf, sizeof(tbuf), ",%s,%s",dmy.constData(), hms.constData());
+ strcat(obuf, tbuf);
+ }
+
+ gpssim_write_sentence(obuf);
+}
+
+static void
+gpssim_trk_hdr(const route_head* rh)
+{
+ if (splitfiles) {
+
+ if (fout) {
+ fatal(MYNAME ": output file already open.\n");
+ }
+
+ QString ofname = QStringLiteral("%1%2%3.gpssim").arg(fnamestr, doing_tracks ? "-track" : "-route").arg(trk_count++, 4, 10, QChar('0'));
+ fout = gbfopen(ofname, "wb", MYNAME);
+ }
+ (void) track_recompute(rh);
+}
+
+static void
+gpssim_trk_ftr(const route_head*)
+{
+ if (splitfiles) {
+ gbfclose(fout);
+ fout = nullptr;
+ }
+}
+
+static void
+gpssim_write()
+{
+ if (waypt_count()) {
+ if (splitfiles) {
+ QString ofname = fnamestr + "-waypoints.gpssim";
+ fout = gbfopen(ofname, "wb", MYNAME);
+ }
+ if (wayptspd && wayptspd[0]) {
+ gpssim_write_spd(strtod(wayptspd, nullptr));
+ }
+ waypt_disp_all(gpssim_write_pt);
+ if (splitfiles) {
+ gbfclose(fout);
+ fout = nullptr;
+ }
+ }
+
+ doing_tracks = 1;
+ track_disp_all(gpssim_trk_hdr, gpssim_trk_ftr, gpssim_write_pt);
+
+ trk_count = 0;
+ doing_tracks = 0;
+ route_disp_all(gpssim_trk_hdr, gpssim_trk_ftr, gpssim_write_pt);
+}
+
+
+ff_vecs_t gpssim_vecs = {
+ ff_type_file,
+ { ff_cap_write, ff_cap_write, ff_cap_write },
+ nullptr,
+ gpssim_wr_init,
+ nullptr,
+ gpssim_wr_deinit,
+ nullptr,
+ gpssim_write,
+ nullptr,
+ &gpssim_args,
+ NULL_POS_OPS
+};
+++ /dev/null
-/*
- Write points to Franson Technology GpsGate simulator
-
- Copyright (C) 2006 Robert Lipe, robertlipe+source@gpsbabel.org
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- */
-
-
-#include "defs.h"
-#include <cmath>
-#include <cstdio>
-#include <cstdlib>
-#include "nmea.h"
-
-#define MYNAME "gpssim"
-
-static gbfile* fout;
-static char* wayptspd;
-static char* splitfiles_opt;
-static int splitfiles;
-static QString fnamestr;
-static int trk_count;
-static int doing_tracks;
-
-static
-QVector<arglist_t> gpssim_args = {
- {
- "wayptspd", &wayptspd, "Default speed for waypoints (knots/hr)",
- nullptr, ARGTYPE_FLOAT, ARG_NOMINMAX, nullptr
- },
- {
- "split", &splitfiles_opt, "Split input into separate files",
- "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
- },
-};
-
-/*
- * The only thing kind of odd about this format is the "split"
- * option. There's some trashing about with the 'splitfiles' toggle
- * to ensure that waypoints land in one file and each track and each
- * route land in files of their own.
- */
-
-static void
-gpssim_wr_init(const QString& fname)
-{
- fnamestr = fname;
- trk_count = 0;
- splitfiles = splitfiles_opt ? xstrtoi(splitfiles_opt, nullptr, 10) : 0;
-
- /* If writing to stdout, never split files */
- if (0 == strcmp("-",splitfiles_opt)) {
- splitfiles = 0;
- }
-
- if (!splitfiles) {
- fout = gbfopen(fname, "wb", MYNAME);
- }
-}
-
-static void
-gpssim_wr_deinit()
-{
- if (fout) {
- gbfclose(fout);
- fout = nullptr;
- }
-
- fnamestr.clear();
-}
-
-
-/*
- * All these files are written in binary mode, so put CR/NL pairs
- * in them explictly in case we're writing from a UNIX-like host.
- */
-
-static void
-gpssim_write_sentence(const char* const s)
-{
- gbfprintf(fout, "$%s*%02X\r\n", s, NmeaFormat::nmea_cksum(s));
-}
-
-static void
-gpssim_write_spd(double knotsperhour)
-{
- char obuf[1024];
-
- snprintf(obuf, sizeof(obuf), "FRSPD,%.2f", knotsperhour);
- gpssim_write_sentence(obuf);
-}
-
-static void
-gpssim_write_pt(const Waypoint* wpt)
-{
- char obuf[1024];
-
- if (wpt->speed_has_value()) {
- gpssim_write_spd(MPS_TO_KNOTS(wpt->speed_value()));
- }
-
- double lat = degrees2ddmm(wpt->latitude);
- double lon = degrees2ddmm(wpt->longitude);
-
- snprintf(obuf, sizeof(obuf), "FRWPT,%10.5f,%c,%011.5f,%c,%.1f",
- fabs(lat), lat < 0 ? 'S' : 'N',
- fabs(lon), lon < 0 ? 'W' : 'E',
- wpt->altitude == unknown_alt ? 0 : wpt->altitude
- );
-
- if (wpt->creation_time.isValid()) {
- char tbuf[20];
-
- QByteArray dmy = wpt->GetCreationTime().toUTC().toString(u"ddMMyy").toUtf8();
- QByteArray hms = wpt->GetCreationTime().toUTC().toString(u"hhmmss").toUtf8();
-
- snprintf(tbuf, sizeof(tbuf), ",%s,%s",dmy.constData(), hms.constData());
- strcat(obuf, tbuf);
- }
-
- gpssim_write_sentence(obuf);
-}
-
-static void
-gpssim_trk_hdr(const route_head* rh)
-{
- if (splitfiles) {
-
- if (fout) {
- fatal(MYNAME ": output file already open.\n");
- }
-
- QString ofname = QStringLiteral("%1%2%3.gpssim").arg(fnamestr, doing_tracks ? "-track" : "-route").arg(trk_count++, 4, 10, QChar('0'));
- fout = gbfopen(ofname, "wb", MYNAME);
- }
- (void) track_recompute(rh);
-}
-
-static void
-gpssim_trk_ftr(const route_head*)
-{
- if (splitfiles) {
- gbfclose(fout);
- fout = nullptr;
- }
-}
-
-static void
-gpssim_write()
-{
- if (waypt_count()) {
- if (splitfiles) {
- QString ofname = fnamestr + "-waypoints.gpssim";
- fout = gbfopen(ofname, "wb", MYNAME);
- }
- if (wayptspd && wayptspd[0]) {
- gpssim_write_spd(strtod(wayptspd, nullptr));
- }
- waypt_disp_all(gpssim_write_pt);
- if (splitfiles) {
- gbfclose(fout);
- fout = nullptr;
- }
- }
-
- doing_tracks = 1;
- track_disp_all(gpssim_trk_hdr, gpssim_trk_ftr, gpssim_write_pt);
-
- trk_count = 0;
- doing_tracks = 0;
- route_disp_all(gpssim_trk_hdr, gpssim_trk_ftr, gpssim_write_pt);
-}
-
-
-ff_vecs_t gpssim_vecs = {
- ff_type_file,
- { ff_cap_write, ff_cap_write, ff_cap_write },
- nullptr,
- gpssim_wr_init,
- nullptr,
- gpssim_wr_deinit,
- nullptr,
- gpssim_write,
- nullptr,
- &gpssim_args,
- NULL_POS_OPS
-};
shape shp ESRI shapefile
igc FAI/IGC Flight Recorder Data Format
garmin_fit fit Flexible and Interoperable Data Transfer (FIT) Activity file
-gpssim gpssim Franson GPSGate Simulation
garmin301 Garmin 301 Custom position and heartrate
garmin_g1000 csv Garmin G1000 datalog input filter file
gdb gdb Garmin MapSource - gdb
file shape shp ESRI shapefile
file igc FAI/IGC Flight Recorder Data Format
file garmin_fit fit Flexible and Interoperable Data Transfer (FIT) Activity file
-file gpssim gpssim Franson GPSGate Simulation
file garmin301 Garmin 301 Custom position and heartrate
file garmin_g1000 csv Garmin G1000 datalog input filter file
file gdb gdb Garmin MapSource - gdb
file rwrwrw shape shp ESRI shapefile
file --rwrw igc FAI/IGC Flight Recorder Data Format
file -wrw-- garmin_fit fit Flexible and Interoperable Data Transfer (FIT) Activity file
-file -w-w-w gpssim gpssim Franson GPSGate Simulation
file rw---- garmin301 Garmin 301 Custom position and heartrate
file --rw-- garmin_g1000 csv Garmin G1000 datalog input filter file
file rwrwrw gdb gdb Garmin MapSource - gdb
option garmin_fit recoverymode Attempt to recovery data from corrupt file boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_garmin_fit.html#fmt_garmin_fit_o_recoverymode
-file -w-w-w gpssim gpssim Franson GPSGate Simulation gpssim
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_gpssim.html
-option gpssim wayptspd Default speed for waypoints (knots/hr) float https://www.gpsbabel.org/WEB_DOC_DIR/fmt_gpssim.html#fmt_gpssim_o_wayptspd
-
-option gpssim split Split input into separate files boolean 0 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_gpssim.html#fmt_gpssim_o_split
-
file rw---- garmin301 Garmin 301 Custom position and heartrate xcsv
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_garmin301.html
option garmin301 snlen Max synthesized shortname length integer 1 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_garmin301.html#fmt_garmin301_o_snlen
garmin_fit Flexible and Interoperable Data Transfer (FIT) Act
allpoints (0/1) Read all points even if latitude or longitude is m
recoverymode (0/1) Attempt to recovery data from corrupt file
- gpssim Franson GPSGate Simulation
- wayptspd Default speed for waypoints (knots/hr)
- split (0/1) Split input into separate files
garmin301 Garmin 301 Custom position and heartrate
snlen Max synthesized shortname length
snwhite (0/1) Allow whitespace synth. shortnames
+++ /dev/null
-#
-# Franson GPSGate simulation
-#
-gpsbabel -i geo -f ${REFERENCE}/geocaching.loc -o gpssim -F ${TMPDIR}/waypoints.gpssim
-compare ${TMPDIR}/waypoints.gpssim ${REFERENCE}
-gpsbabel -i gpx -f ${REFERENCE}/track/tracks.gpx -o gpssim -F ${TMPDIR}/tracks.gpssim
-compare ${TMPDIR}/tracks.gpssim ${REFERENCE}/track
-gpsbabel -i gpx -f ${REFERENCE}/track/nmeadate.gpx -o gpssim -F ${TMPDIR}/nmeadate.gpssim
-compare ${REFERENCE}/track/nmeadate.gpssim ${TMPDIR}/nmeadate.gpssim
-
//extern ff_vecs_t wbt_fvecs;
extern ff_vecs_t vcf_vecs;
extern ff_vecs_t gtm_vecs;
-extern ff_vecs_t gpssim_vecs;
#if CSVFMTS_ENABLED
extern ff_vecs_t garmin_txt_vecs;
#endif // CSVFMTS_ENABLED
LegacyFormat vcf_fmt {vcf_vecs};
UnicsvFormat unicsv_fmt;
LegacyFormat gtm_fmt {gtm_vecs};
- LegacyFormat gpssim_fmt {gpssim_vecs};
#if CSVFMTS_ENABLED
LegacyFormat garmin_txt_fmt {garmin_txt_vecs};
#endif // CSVFMTS_ENABLED
"gtm",
nullptr,
},
- {
- &gpssim_fmt,
- "gpssim",
- "Franson GPSGate Simulation",
- "gpssim",
- nullptr,
- },
#if CSVFMTS_ENABLED
{
&garmin_txt_fmt,
+++ /dev/null
- <para>
- This is a write-only format used to feed waypoints, tracks, and routes
- into <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://franson.com/">Franson Technolgies'</link>
- <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://franson.com/gpsgate/">GpsGate simulator</link>.
- </para>
- <para>
- To use these files in GpsGate, select 'Simulator' and then
- "File->Open".
- </para>
+++ /dev/null
-<para>When this option is specified, GPSBabel will split
- split the output into multiple files using the output filename
- as a base. For example, if you specify an output file of 'mytrip',
-<simplelist type="vert">
- <member>mytrip-waypoints.gpssim - will contain the waypoints.</member>
- <member>mytrip-track0000.gpssim - will contain the first track.</member>
- <member>mytrip-track0001.gpssim - will contain the second track.</member>
- <member>... and so on.</member>
- <member>mytrip-route0000.gpssim - will contain the first route.</member>
- <member>mytrip-route0001.gpssim - will contain the seconds route.</member>
- <member>... and so on.</member>
-</simplelist>
-</para>
-
-<para>
-Valid values for this option are 0 (off) and 1 (on). The default is '0'.
-</para>